package com.battery;

import com.battery.dao.PowerBankDao;
import com.battery.pojo.PowerBank;
import com.battery.util.SpringUtil;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.ApplicationContext;

@SpringBootTest
class PowerBanktest {

    @Test
    public void powerBankDaoTest() {
        ApplicationContext ctx = SpringUtil.getApplicationContext();
        System.out.println(ctx);
        PowerBankDao powerBankDao = (PowerBankDao) ctx.getBean("powerBankDao");
        PowerBank powerBank=new PowerBank(1,2,2,2,2,2,2,2,2);

        System.out.println(powerBankDao.findByPb_Id(1));
//        List<PowerBank> allPowerBank = powerBankDao.findAllPowerBank();

    }
    /*@Test
    public void insertUserControllerTest() {
        ApplicationContext temp = SpringUtil.getApplicationContext();
        PowerBankController userController= (PowerBankController) temp.getBean("PowerBankController");
        Timestamp create_time = Timestamp.valueOf("2020-12-20 21:23:58");
        Timestamp dead_line = Timestamp.valueOf("2021-4-28 23:15:28");
        PowerBank powerbank=new PowerBank(1,"张三",0,"#652215","男",
                create_time,dead_line,50.0,"510132200002281549",60);
        System.out.println(powerbankController.addUser(powerbank));
    }*/

}
